1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.apache.tools.ant.input;
24
25 /***
26 * Encapsulates an input request.
27 * Modified for Antigen from the original Ant version
28 *
29 * @version $Revision: 1.2 $
30 * @since Ant 1.5
31 */
32 public class InputRequest {
33 private String prompt;
34 private String input;
35 private String defaul;
36 private String addproperty;
37
38 /***
39 * @param prompt The prompt to show to the user. Must not be null.
40 */
41 public InputRequest(String prompt) {
42 if (prompt == null) {
43 throw new IllegalArgumentException("prompt must not be null");
44 }
45
46 this.prompt = prompt;
47 }
48 /***
49 * @param prompt The prompt to show to the user. Must not be null.
50 * @param defaul The default value, should no input be entered
51 * @param addproperty
52 */
53 public InputRequest(String prompt, String defaul, String addproperty) {
54 this(prompt);
55 this.defaul = defaul;
56 this.addproperty = addproperty;
57 }
58
59
60 /***
61 * Retrieves the prompt text.
62 */
63 public String getPrompt() {
64 return prompt;
65 }
66
67 /***
68 * Sets the user provided input.
69 */
70 public void setInput(String input) {
71 this.input = input;
72 }
73
74 /***
75 * Returns the default prompt
76 */
77 public String getDefault() {
78 return defaul;
79 }
80
81 /***
82 * Is the user input valid?
83 */
84 public boolean isInputValid() {
85 return true;
86 }
87
88 /***
89 * Retrieves the user input.
90 */
91 public String getInput() {
92 return input;
93 }
94
95 /***
96 * @return Returns the addproperty.
97 */
98 public String getAddproperty() {
99 return addproperty;
100 }
101 }